package com.sansecy.javafx;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.effect.Glow;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.stage.Stage;

public class EffectsSample extends Application {

    @Override
    public void start(Stage stage) throws Exception {
//Creating an image
        Image image = new Image("https://www.tutorialspoint.com/green/images/logo.png");

//Setting the image view
        ImageView imageView = new ImageView(image);

//Setting the position of the image
        imageView.setX(100);
        imageView.setY(70);

//setting the fit height and width of the image view
        imageView.setFitHeight(200);
        imageView.setFitWidth(400);

//Setting the preserve ratio of the image view
        imageView.setPreserveRatio(true);
        Glow glow = new Glow();
        //setting the level property
        glow.setLevel(0.9);
        imageView.setEffect(glow);

        //Creating a Group object
        Group root = new Group(imageView);

        //Creating a scene object
        Scene scene = new Scene(root, 600, 300);

        //Setting title to the Stage
        stage.setTitle("Setting font to the text");

        //Adding scene to the stage
        stage.setScene(scene);

        //Displaying the contents of the stage
        stage.show();

    }
}
